package com.csun.cmny.provider.model.dto.contract;


import com.csun.cmny.provider.validator.OmcMonitorLogValidator;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
public class ContractSaveDto implements Serializable {


    /*老人id*/
    private Long oldManId;


    @NotEmpty(message = "{contract.oldName.null}")
    private String oldName;

    @Pattern(regexp = "^((\\+86)|(86))?(13|15|16|17|18|19)\\d{9}$",
            message = "{contract.phone.error}")
    @NotEmpty(message = "{contract.phone.null}")
    private String oldPhone;

    /*合同编号*/
    private String contractNo;

    /*合同开始时间*/
    @NotEmpty(message = "{contract.date.null.start}")
    @Size(min = 1, max = 10, message = "{Monitorlog.date.length.error}",groups = {OmcMonitorLogValidator.class})
    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{Advisory.date.pattem.error}")
    private String startDate;

    /*合同结束时间*/
    @NotEmpty(message = "{contract.date.null.end}")
    @Size(min = 1, max = 10, message = "{Monitorlog.date.length.error}",groups = {OmcMonitorLogValidator.class})
    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{Advisory.date.pattem.error}")
    private String endDate;

    /*楼宇*/
    @NotEmpty(message = "{contract.buildingName.null}")
    private String buildingName;

    /*楼层*/
    @NotNull(message = "{contract.floorNo.null}")
    private Integer floorNo;

    /*房间编号*/
    @NotEmpty(message = "{contract.roomNo.null}")
    private String roomNo;

    /*床位编号*/
    @NotEmpty(message = "{contract.bedNo.null}")
    private String bedNo;



    /*备注*/
    private String remark;

    /*老人身份证号*/
    @NotEmpty(message = "{contract.idCard.null}")
    private  String oldIdCard;
}
